<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>p3_边框</title>
    <style>
        .d1 {
            width: 200px;
            height: 200px;
            background-color: #0aa1ed;
            border: 5px solid #f00;
            border-top: 5px double #0f0;
            border-radius: 100px;
        }
        .d2 {
            width: 200px;
            height: 200px;
            background-color: purple;
            /*默认加边框和內间距都会使元素变大*/
            border: 5px solid #f00;
            padding-left: 50px;
            padding-top: 50px;
            /*外间距不属于元素本身的大小,但外间距会占页面的布局空间*/
            margin: 50px;
            /* 将盒子模型计算方案切换成边框盒子:
            无论是加內间距还是边框,元素大小不变,都算在预设的宽高之内(纯纯自我内耗)*/
            box-sizing: border-box;
        }
        span {
          background-color: #FFFF00;
        }
        .s2 {
            /*行内元素的内间距实际上也不生效,但视觉上是生效的,一般不要用!*/
            padding: 50px;
        }
    </style>
</head>
<body>
    <div class="d1"></div>
    <div class="d2">內间距测试</div>
    <hr>
    <span>span1</span><span class="s2">span2</span><span>span3</span>
    <h1>苍茫的天涯是我的爱,绵绵的青山脚下花正开,什么样的节奏是最呀最摇摆</h1>
</body>
</html>